Embodiments of the present invention relate to database systems and, more specifically, to replicating database updates with batching.
In many cases where records in a database are critical enough to warrant redundant record keeping, a target database may be maintained as a backup for a source database. Database replication is then used to keep the target database in sync with the source database. In database replication, when updates are made to the source database, those updates are then applied to the target database as well.
A simple mechanism for applying updates to the target database is to send all columns of the source database to the target database regardless of which columns have changed, and then the target database applies the updates via an update statement where all columns are included in the set clause. Alternatively, the source database can send only those columns that have been updated, and then the target database generates an update statement that changes only the updated columns of the target database. This minimizes the amount of data that is sent over the network and minimizes the number of columns the target database must change.